package com.gitee.feizns.webtemplate.web.controller;

import com.gitee.feizns.webtemplate.commons.exception.service.ServiceException;
import com.gitee.feizns.webtemplate.entity.ao.commons.upload.FaUpload;
import com.gitee.feizns.webtemplate.entity.vo.commons.result.Result;
import com.gitee.feizns.webtemplate.entity.vo.commons.upload.FvUpload;
import com.gitee.feizns.webtemplate.service.commons.ResourceService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author feizns
 * @since 2019/5/16
 */
@RestController
@RequestMapping("/upload")
public class UploadController {

//    @Autowired
//    private ResourceService resourceService;
//
//    /**
//     * 上传文件
//     * @param faUpload
//     * @return
//     */
//    @PostMapping(value = "/upload", consumes = "multipart/form-data")
//    public Result<FvUpload> upload(FaUpload faUpload) {
//        if ( faUpload.getFile().isEmpty() )
//            throw new ServiceException("上传文件不能为空.");
//
//        return Result.ok(resourceService.add(faUpload));
//    }

}
